<template>
  <a-card :bordered='false'>
    <search :config='searchConfig' @search='search' @getHeight='getHeight' />
    <div class='page_table'>
      <vxe-grid
        ref='xGrid'
        :border='true'
        :resizable='true'
        :showOverflow='true'
        size='mini'
        :loading='loading'
        :height='pageHeight-seachHeight-94'
        :align='left'
        :columns='columns'
        :data='dataSource'
        :toolbar-config="tableToolbar"
       :checkbox-config="checkboxConfig"
        v-bind='vexConfig'
        @checkbox-change='selectChangeEvent'
        @checkbox-all="selectChangeEvent"
      >
        <template #toolbar_buttons>
          <div class='table-operator'>
            <a-button v-has="'getGoodsAdress:add'" @click='handleAdd'>新增</a-button>
            <a-button v-has="'getGoodsAdress:delete'" @click='batchDel'>删除</a-button>
            <a-button type="primary" @click="downExportXls('cnReceivedGoodsAddress_service')">导出</a-button>
          </div>
        </template>


        <template  #action='{ row,rowIndex }'>
          <a v-has="'getGoodsAdress:update'" @click='handleEdit(row)'>编辑</a>
          <a-divider type='vertical' />
          <a href='javascript:' @click='handleBusiness("收货地址",row)'>日志</a>

        </template>
        <template #custCode='{ row,rowIndex }'>
          <a @click="handleDetail(row)">{{ row.custCode }}</a>
        </template>
        <template #update='{ row }'>
          <a-switch :checked='row.status' size='small' @change='handleStatus(row,$event)' />
        </template>
        <template #update='{ row }'>
          <a-switch :checked='row.status' size='small' @change='handleStatus(row,$event)' />
        </template>

        <template #pager>
          <vxe-pager
            :layouts="['Total', 'PrevJump', 'PrevPage', 'Number', 'NextPage', 'NextJump','Sizes', 'FullJump']"
            :currentPage.sync='ipagination.current'
            :page-size.sync='ipagination.pageSize'
            :total='ipagination.total'
            :pageSizes='ipagination.pageSizeOptions'
            @page-change='handlePageChange'>
          </vxe-pager>
        </template>
      </vxe-grid>
    </div>
    <getGoods ref="modalForm" @ok="modalFormOk"></getGoods>
    <business-log ref='businessLog'></business-log>
  </a-card>
</template>

<script>

import getGoods from './modules/GetGoodsModal.vue'
import { PageListMixin } from '@/mixins/PageListMixin'
export default {
  name: 'getGoodsAdress',
  mixins:[PageListMixin],
  components:{
    getGoods,
  },
  data() {
    return {
      description: '收货地址',
      searchConfig: [
        // {
        //   type: 'input',
        //   name: 'receivingAddressCode',
        //   placeholder: '收货地址编号'
        // },
        {
          type: 'input',
          name: 'custCode',
          placeholder: '客户编号'
        },
        {
          type: 'input',
          name: 'custName',
          placeholder: '客户名称'
        },
      ],
      columns:[
        { type: 'checkbox', minWidth: 60, fixed: 'left' },
        // {
        //   title: '收货地址编号',
        //   align: 'left',
        //   minWidth:100,
        //   fixed: 'left',
        //   field: 'receivingAddressCode',
        //   slots: { default: 'receivingAddressCode'}
        // },
        {
          title: '客户编号',
          align: 'left',
          minWidth:80,
          field: 'custCode',
          slots: { default: 'custCode'}
        },
        {
          title: '客户名称',
          align: 'left',
          minWidth:80,
          field: 'custName',
        },
        {
          title: '收货地区',
          align: 'left',
          minWidth:80,
          field: 'receivedGoodsArea',
        },

        {
          title: '详细地址',
          align: 'left',
          minWidth:80,
          field: 'addressDetailed',
        },
        {
          title: '收货人姓名',
          align: 'left',
          minWidth:80,
          field: 'receivedGoodsName',
        },
        {
          title: '收货人电话',
          align: 'left',
          minWidth:80,
          field: 'receivedGoodsTel',
        },
        {
          title: '创建人',
          align: 'left',
          minWidth:80,
          field: 'createName',
        },
        {
          title: '创建时间',
          align: 'left',
          minWidth:80,
          field: 'createTime',
        },
        {
          title: '更新人',
          align: 'left',
          minWidth:80,
          field: 'updateName',
        },
        {
          title: '更新时间',
          align: 'left',
          minWidth:80,
          field: 'updateTime',
        },
        // {
        //   title: '备注',
        //   align: 'left',
        //   minWidth:80,
        //   field: 'remarks',
        // },
        {
          title: '操作',
          align: 'left',
          fixed: 'right',
          minWidth:120,
          field: 'action',
          slots: { default: 'action'}
        },
      ],
      dataSource:[
      ],
      isorter: {
        permflag: 'received_goods_address_page_impl'
      },
      url:{
        list: window._CONFIG['domianURL'] + "/receivedgoodsaddress/cnReceivedGoodsAddress/findPageList",
        deleteBatch:window._CONFIG['domianURL'] + '/receivedgoodsaddress/cnReceivedGoodsAddress/deleteBatch',
        delete: window._CONFIG['domianURL'] + '/receivedgoodsaddress/cnReceivedGoodsAddress/delete',
        detail: window._CONFIG['domianURL'] + '/receivedgoodsaddress/cnReceivedGoodsAddress/getInfo'

      },
    }
  },
  created(){

  },
  methods:{

  }
}
</script>

<style scoped>
@import '~@assets/less/common.less';
</style>